package com.itdragon.cloud.eurekaServer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @EnableEurekaServer 启动一个服务注册中心
 * @SpringBootApplication SpringBoot 启动Application的注解
 *
 */
@EnableDiscoveryClient
@SpringBootApplication
public class RibbonServerApplication {

	public static void main(String[] args) {
		SpringApplication.run(RibbonServerApplication.class, args);
	}
	
	@Bean	// 注册bean
	@LoadBalanced // 开启负载均衡的功能
	RestTemplate restTemplate () {
		return new RestTemplate();
	}
	
}
